package org.example.demo.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.example.demo.entity.User;
import org.example.demo.util.encrypt.EncryptTypeHandler;
import org.example.demo.vo.UserStatusCntVO;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select("select * from user where account = #{account} and pwd = #{password, typeHandler=org.example.demo.util.encrypt.EncryptTypeHandler}")
    User checkPwdWithAccount(String account,String password);


    /**
     * 获取用户状态数量
     * @return
     */
    List<UserStatusCntVO> getUserStatusCnt();
}
